<!doctype html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>社矫-基本信息查看</title>
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css" />
    <script src="/static/js/common/common.js" type="text/javascript"></script>
    <link href="/webjars/miniui/css/demo.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/default.css" rel="stylesheet" type="text/css" />
    <style>
        .discell {
            text-align:right;
            width:20%;
        }
        .input {
            width:30%;
        }
    </style>
</head>
<body>
<form id="form1" method="post" style="height:100%;width: 100%;overflow-x: auto;overflow-y: auto;">
    <!-- 用户 编辑框START-->
    <div id="editform" class="form" style="padding:10px;">
        <input name="id" id="id" class="mini-hidden" style="width: 100%;" readonly />
        <input name="orgName" class="mini-hidden" style="width: 100%;" readonly />
        <input name="priNum" id="priNum" class="mini-hidden" style="width: 100%" readonly />
        <table class="form-table" align="center" style="width:85%" cellspacing="8">
            <tr>
                <td style="font-weight: bold;text-align: right"><span class="legend">基础信息</span></td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>姓&emsp;&emsp;名:</td>
                <td class="input">
                    <input name="pName" id="pName" class="mini-textbox" readonly="readonly" style="width: 80%;" />
                </td>
                <td class="discell">曾&nbsp;&nbsp;用&nbsp;&nbsp;名:</td>
                <td class="input">
                    <input name="usedName" id="usedName" class="mini-textbox" readonly="readonly" value="无" style="width: 80%;" />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>性&emsp;&emsp;别:</td>
                <td class="input">
                    <input name="sex" id="sex" class="mini-combobox" readonly="readonly"
                           textField="codeName" valueField="codeId" style="width: 80%;"
                           url="/azbj/inmates/baseinfo/getTbsysCode?codeType=2_2&pcodeId=-1&sn=1" required="true" />
                </td>
                <td class="discell"><font color="#dc143c">*</font>民&emsp;&emsp;族:</td>
                <td>
                    <input name="nationality" id="nationality" class="mini-combobox" required="true" readonly="readonly"
                           textField="codeName" valueField="codeId" emptyText="请选择..." style="width: 80%;"
                           url="/azbj/shzzgl/socialOrgInfo/getComboboxData?codeType=2_4"
                    />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>证件类型:</td>
                <td>
                    <input name="idType" id="idType" class="mini-combobox" required="true" readonly="readonly"
                           textField="codeName" valueField="codeId" emptyText="请选择..." style="width: 80%;"
                           url="/azbj/inmates/baseinfo/getTbsysCode?codeType=2_13&pcodeId=-1&sn=1"
                    />
                </td>
                <td class="discell">身份证号:</td>
                <td>
                    <input name="idNum" id="idNum" class="mini-textbox" readonly="readonly"
                           onvaluechanged="onMouseOut()" style="width: 80%;" />
                </td>
            </tr>
            <tr>
                <td class="discell">出生日期:</td>
                <td class="input">
                    <input property="editor" class="mini-datepicker" id="age" name="age" style="width: 80%;" readonly="readonly" allowInput="true" />
                </td>
                <td class="discell"><font color="#dc143c">*</font>入矫日期:</td>
                <td class="input">
                    <input property="editor" class="mini-datepicker" id="addtime" name="addtime" required="true" readonly="readonly" allowInput="true"
                           style="width: 80%;" />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>文化程度:</td>
                <td>
                    <input name="education" id="education" class="mini-combobox" readonly="readonly"
                           textField="codeName" valueField="codeId" emptyText="请选择..." style="width: 80%;"
                           url="/azbj/inmates/baseinfo/getTbsysCode?codeType=2_5&pcodeId=0&sn=0" required="true"
                    />
                </td>
                <td class="discell"><font color="#dc143c">*</font>衔接途径:</td>
                <td>
                    <input class="mini-textbox" style="width: 80%;" readonly="readonly" value="社矫释放">
                    <input style="display:none" name="tujing" id="tujing" class="mini-combobox"
                           textField="text" valueField="id" value="02" />
                </td>
            </tr>

            <tr>
                <td colspan="4">
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold;text-align: right"><span class="legend">户籍信息</span></td>
            </tr>
            <tr>
                <td style="font-weight: bold;text-align: center"></td>
                <td class="input" align="left">
                    <input name="hjType" id="hjType" class="mini-radiobuttonlist"
                           data="[{ id: ''+'01', name: '户籍完整人员' },{ id: ''+'02', name: '查不清户籍人员' }]"
                           textField="name" valueField="id" value="01" required="true" showNullItem="true"
                           onvaluechanged="hjTypeOnclick()" readonly />
                </td>
            </tr>
            <tr id="hjlx">
                <td class="discell"><font color="#dc143c">*</font>户籍类型:</td>
                <td colspan="3">
                    <input name="priAddr" id="priAddr" class="mini-radiobuttonlist"
                           data="[{ id: ''+'01', name: '农村户籍' },{ id: ''+'02', name: '城镇户籍' }]"
                           textField="name" valueField="id" value="01" required="true" showNullItem="true"
                           onvaluechanged="hjOnclick()" readonly="readonly" />
                </td>
            </tr>
        </table>
    </div>

    <!-- 户籍信息-->
    <div id="wzhjry" class="form" style="padding:10px;">
        <table class="form-table" align="center" style="width:85%" cellspacing="8">
            <tr>
                <td style="width: 20%;text-align: right"><font color="#dc143c">*</font>
                    户籍地址:
                </td>
                <td colspan="3" style="width: 80%">
                    <input id="nativepro" name="nativepro" class="mini-combobox" required="true" emptyText="省份"
                           style="width:22%;" readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                    <input id="nativecity" name="nativecity" class="mini-combobox" required="true" emptyText="市"
                           style="width: 23%" readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                    <input id="nativecou" name="nativecou" class="mini-combobox" required="true" emptyText="县"
                           style="width: 23%" readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                    <input id="nativevill" name="nativevill" class="mini-combobox" emptyText="街道" style="width:23%"
                           readonly="readonly"
                           textfield="codeName" valueField="codeId" />
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right"></td>
                <td colspan="3" style="width: 80%">
                    <input class="mini-textbox" required="true" style="width: 92.5%" emptyText="详细地址" id="nativenum"
                           name="nativenum" readonly="readonly" />
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right">
                    <#if "${localCode !''}"=='140000'>
                        日常居住地:
                    <#else>
                        居住地址:
                    </#if>
                </td>
                <td colspan="3" style="width: 80%">
                    <input id="placepro" name="placepro" class="mini-combobox" emptyText="省份" style="width:22%;"
                           textfield="codeName" valueField="codeId" readonly="readonly"/>
                    <input id="placecity" name="placecity" class="mini-combobox" emptyText="市" style="width: 23%"
                           textfield="codeName" valueField="codeId" readonly="readonly" />
                    <input id="placecou" name="placecou" class="mini-combobox" emptyText="县" style="width: 23%"
                           textfield="codeName" valueField="codeId"  readonly="readonly" />
                    <input id="placevill" name="placevill" class="mini-combobox" emptyText="街道" style="width: 23%"
                           readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right"></td>
                <td colspan="3" style="width: 80%">
                    <input class="mini-textbox" style="width: 92.5%" emptyText="详细地址" id="placenum" name="placenum" readonly="readonly" />
                </td>
            </tr>
        </table>
    </div>

    <#--查不清户籍人员-->
    <div id="cbqhj" class="form" style="padding:10px;display: none">
        <table class="form-table" align="center" style="margin-left: 10%;margin-right: 10%" cellspacing="8">

            <tr>
                <td style="width: 20%;text-align: right">
                    户籍地址:
                </td>
                <td colspan="3" style="width: 80%">
                    户籍地址不明
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right">
                    原侦查机关所在地:
                </td>
                <td colspan="3" style="width: 80%">
                    <input id="investigatePro" name="investigatePro" class="mini-combobox" emptyText="省份" style="width:22%;"
                           textfield="codeName" valueField="codeId" required="true" readonly="readonly"
                            <#--onclick="onNoLiveChanged('investigatePro')" onvaluechanged="onNoChanged('investigatePro')"-->/>
                    <input id="investigateCity" name="investigateCity" class="mini-combobox" emptyText="市" style="width: 23%"
                           textfield="codeName" valueField="codeId" <#--onclick="onNoLiveChanged('investigateCity')"-->
                           required="true" readonly="readonly"
                            <#--onvaluechanged="onNoChanged('investigateCity')"-->/>
                    <input id="investigateCou" name="investigateCou" class="mini-combobox" emptyText="县" style="width: 23%"
                           textfield="codeName" valueField="codeId" <#--onclick="onNoLiveChanged('investigateCou')"-->
                           required="true" readonly="readonly"
                            <#--onvaluechanged="onNoChanged('investigateCou')"-->/>
                    <input id="investigateVill" name="investigateVill" class="mini-combobox" emptyText="街道" style="width: 23%"
                           required="true" readonly="readonly"
                           textfield="codeName" valueField="codeId"<#--onclick="onNoLiveChanged('investigateVill')"-->/>

                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right"></td>
                <td colspan="3" style="width: 80%">
                    <input class="mini-textbox" style="width: 92.5%" emptyText="详细地址" id="investigateNum" name="investigateNum"
                           required="true" readonly="readonly" />
                </td>
            </tr>
        </table>
    </div>

    <div id="fdlj" class="form" style="padding:10px;display: none">
        <table class="form-table" align="center" style="margin-left: 10%;margin-right: 10%" cellspacing="8">
            <tr>
                <td style="width: 20%;text-align: right">
                    <font color="#dc143c">*</font>具体类型:
                </td>
                <td colspan="3" style="width: 80%;">
                    <input name="detailType" id="detailType" class="mini-combobox" value="${detailType!''}"
                           data="[{ id: 1, name: '外国籍' },{ id: 2, name: '无国籍' },{ id: 3, name: '香港' },{ id: 4, name: '澳门' },{ id: 5, name: '台湾' }]"
                           textField="name" valueField="id" value="1" required="true" showNullItem="false"
                           readonly />
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right">
                    逮捕机构:
                </td>
                <td colspan="3" style="width: 80%">
                    <input id="arrestpro" name="arrestpro" class="mini-combobox" required="true" emptyText="省份"
                           style="width:22%;" readonly="readonly"
                           textfield="codeName" valueField="codeId"
                            <#--onclick="onDBLiveChanged('arrestpro')" onvaluechanged="onDBChanged('arrestpro')"-->/>
                    <input id="arrestcity" name="arrestcity" class="mini-combobox" required="true" emptyText="市"
                           style="width: 23%" readonly="readonly"
                           textfield="codeName" valueField="codeId" <#--onclick="onDBLiveChanged('arrestcity')"
                           onvaluechanged="onDBChanged('arrestcity')"-->/>
                    <input id="arrestcou" name="arrestcou" class="mini-combobox" required="true" emptyText="县"
                           style="width: 23%" readonly="readonly"
                           textfield="codeName" valueField="codeId" <#--onclick="onDBLiveChanged('arrestcou')"
                           onvaluechanged="onDBChanged('arrestcou')"-->/>
                    <input id="arrestvill" name="arrestvill" class="mini-combobox" emptyText="街道" style="width: 23%"
                           readonly="readonly"
                           textfield="codeName" valueField="codeId"<#--onclick="onDBLiveChanged('arrestvill')"--> required="true" />

                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right"></td>
                <td colspan="3" style="width: 80%">
                    <input class="mini-textbox" required="true" style="width: 92.5%" emptyText="详细地址" name="arrestnum"
                           id="arrestnum" readonly="readonly" />
                </td>
            </tr>
        </table>
    </div>
</form>

<script type="text/javascript">
    mini.parse();
    var form = new mini.Form("form1");
    var name = mini.get("pName").getValue();
    var id = mini.get("id");
    var priNum = mini.get("priNum");
    var idNum = mini.get("idNum");
    var nativepro = mini.get("nativepro");
    var nativecity = mini.get("nativecity");
    var nativecou = mini.get("nativecou");
    var nativevill = mini.get("nativevill");
    var nativenum = mini.get("nativenum");

    var placepro = mini.get("placepro");
    var placecity = mini.get("placecity");
    var placecou = mini.get("placecou");
    var placevill = mini.get("placevill");
    var placenum = mini.get("placenum");

    var arrestpro = mini.get("arrestpro");
    var arrestcity = mini.get("arrestcity");
    var arrestcou = mini.get("arrestcou");
    var arrestvill = mini.get("arrestvill");
    var arrestnum = mini.get("arrestnum");

    var investigatePro = mini.get("investigatePro");
    var investigateCity = mini.get("investigateCity");
    var investigateCou = mini.get("investigateCou");
    var investigateVill = mini.get("investigateVill");
    var investigateNum = mini.get("investigateNum");

    function saveData() {
        if (idNum.getValue() != "") {  // 如果身份证号不为空，对身份号进行校验
            if (!onIDCardsValidation(idNum.getValue())) {
                mini.alert("请输入正确的身份证号");
                return;
            }
        }

        form.validate();
        if (form.isValid() == false) {
            return;
        }
        var data = form.getData();
        var json = mini.encode(data);

        $.ajax({
            url: "/azbj/inmates/baseinfo/save",
            data: {data: json},
            type: "post",
            success: function (success) {
                if (success.code == 1) {
                    var idstr = success.data.id;
                    var priNumstr = success.data.priNum;
                    priNum.setValue(priNumstr);
                    id.setValue(idstr);
                    mini.alert("保存成功");
                } else if (success.code = 5599) {
                    mini.alert(success.message);
                } else {
                    mini.alert("保存失败");
                }
            }
        })
    }

    function hjOnclick() {
        var value = mini.get("priAddr").getValue();
        if (value == "02") { // 城镇户籍
            document.getElementById("wzhjry").style.display = "block";
            document.getElementById("fdlj").style.display = "none";
            document.getElementById("cbqhj").style.display = "none";
        } else if (value == "03") {
            // 户籍为监所
            document.getElementById("wzhjry").style.display = "none";
            document.getElementById("fdlj").style.display = "none";
            document.getElementById("cbqhj").style.display = "none";
        }  else {//农村户籍
            document.getElementById("wzhjry").style.display = "block";
            document.getElementById("fdlj").style.display = "none";
            document.getElementById("cbqhj").style.display = "none";
        }
    }

    /**
     * 查不清户籍 与 户籍完整人员大类显示控制方法
     */
    function hjTypeOnclick() {
        var value = mini.get("hjType").getValue();
        if (value == "02") { //查不清户籍人员
            document.getElementById("wzhjry").style.display = "none";
            document.getElementById("fdlj").style.display = "none";
            document.getElementById("hjlx").style.display = "none";
            document.getElementById("cbqhj").style.display = "block";
        } else {
            document.getElementById("wzhjry").style.display = "block";
            document.getElementById("fdlj").style.display = "none";
            document.getElementById("cbqhj").style.display = "none";
            document.getElementById("hjlx").style.display = "";
        }
    }

    /**
     * 户籍地址
     * @param e
     */
    function onDeptChanged(e) {
        // placepro placecity  placecou placevill
        if ("nativepro" == e) {
            nativepro.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=-1";
            nativepro.setUrl(url);
            nativepro.select(0);
        }
        if ("nativecity" == e) {
            var codeId = nativepro.getValue();
            nativecity.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=" + codeId;
            nativecity.setUrl(url);
            nativecity.select(0);
        }

        if ("nativecou" == e) {
            var codeId = nativecity.getValue();
            nativecou.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=" + codeId;
            nativecou.setUrl(url);
            nativecou.select(0);
        }

        if ("nativevill" == e) {
            var parent_code = nativecou.getValue();
            nativevill.setValue("");
            var url = "/azbj/getCodeDetail?codeType=2_1&codeId=" + parent_code;
            nativevill.setUrl(url);
            nativevill.select(0);
        }
    }

    function onValueChanged(e) {
        if ("nativepro" == e) {
            nativecity.setValue("");
            nativecou.setValue("");
            nativevill.setValue("");
        }
        if ("nativecity" == e) {
            nativecou.setValue("");
            nativevill.setValue("");
        }
        if ("nativecou" == e) {
            nativevill.setValue("");
        }
    }

    /**
     * 居住地址
     *     placepro  placecity placecou placevill placenum
     * @param e
     */
    function onLiveChanged(e) {
        if ("placepro" == e) {
            placepro.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=-1";
            placepro.setUrl(url);
            placepro.select(0);
        }
        if ("placecity" == e) {
            var codeId = placepro.getValue();
            placecity.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=" + codeId;
            placecity.setUrl(url);
            placecity.select(0);
        }

        if ("placecou" == e) {
            var codeId = placecity.getValue();
            placecou.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=" + codeId;
            placecou.setUrl(url);
            placecou.select(0);
        }

        if ("placevill" == e) {
            var parent_code = placecou.getValue();
            placevill.setValue("");
            var url = "/azbj/getCodeDetail?codeType=2_1&codeId=" + parent_code;
            placevill.setUrl(url);
            placevill.select(0);
        }
    }

    function onChanged(e) {
        if ("placepro" == e) {
            placecity.setValue("");
            placecou.setValue("");
            placevill.setValue("");
        }
        if ("placecity" == e) {
            placecou.setValue("");
            placevill.setValue("");
        }
        if ("placecou" == e) {
            placevill.setValue("");
        }
    }

    /**
     * 监所地址
     * @param e
     */
    function onJsDeptChanged(e) {
        if ("prisonspro" == e) {
            prisonspro.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=-1";
            prisonspro.setUrl(url);
            prisonspro.select(0);
        }
        if ("prisonscity" == e) {
            var codeId = prisonspro.getValue();
            prisonscity.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=" + codeId;
            prisonscity.setUrl(url);
            prisonscity.select(0);
        }

        if ("prisonscou" == e) {
            var codeId = prisonscity.getValue();
            prisonscou.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=" + codeId;
            prisonscou.setUrl(url);
            prisonscou.select(0);
        }

        if ("prisonsvill" == e) {
            var parent_code = prisonscou.getValue();
            prisonsvill.setValue("");
            var url = "/azbj/getCodeDetail?codeType=2_1&codeId=" + parent_code;
            prisonsvill.setUrl(url);
            prisonsvill.select(0);
        }
    }

    /**
     * 逮捕地址
     * arrestpro  arrestcity arrestcou arrestvill
     * @param e
     */
    function onDBLiveChanged(e) {
        if ("arrestpro" == e) {
            arrestpro.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=-1";
            arrestpro.setUrl(url);
            arrestpro.select(0);
        }
        if ("arrestcity" == e) {
            var codeId = arrestpro.getValue();
            arrestcity.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=" + codeId;
            arrestcity.setUrl(url);
            arrestcity.select(0);
        }

        if ("arrestcou" == e) {
            var codeId = arrestcity.getValue();
            arrestcou.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=" + codeId;
            arrestcou.setUrl(url);
            arrestcou.select(0);
        }

        if ("arrestvill" == e) {
            var parent_code = arrestcou.getValue();
            arrestvill.setValue("");
            var url = "/azbj/getCodeDetail?codeType=2_1&codeId=" + parent_code;
            arrestvill.setUrl(url);
            arrestvill.select(0);
        }
    }

    function onDBChanged(e) {
        if ("arrestpro" == e) {
            arrestcity.setValue("");
            arrestcou.setValue("");
            arrestvill.setValue("");
        }
        if ("arrestcity" == e) {
            arrestcou.setValue("");
            arrestvill.setValue("");
        }
        if ("arrestcou" == e) {
            arrestvill.setValue("");
        }
    }

    window.onload = function () {
        var data = parent.setChildValue();
        priNum.setValue(data.priNum);
        SetData(priNum.getValue());
    }

    function SetData(data) {
        form.setEnabled(false);
        if (data) {
            mini.get("id").setEnabled(false);
        }
        // 根据ID去数据库中查询数据
        $.ajax({
            url: "/azbj/inmates/getbaseinfo?prinum=" + data,
            type: "post",
            dataType: "json",
            success: function (bsdata) {
                var bf = mini.decode(bsdata);
                form.setData(bsdata);
                form.setChanged(false);

                nativepro.setData([{codeId: bsdata.nativepro, codeName: bsdata.nativeproName}]);
                nativecity.setData([{codeId: bsdata.nativecity, codeName: bsdata.nativecityName}]);
                nativecou.setData([{codeId: bsdata.nativecou, codeName: bsdata.nativecouName}]);
                nativevill.setData([{codeId: bsdata.nativevill, codeName: bsdata.nativevillName}]);

                placepro.setData([{codeId: bsdata.placepro, codeName: bsdata.placeproName}]);
                placecity.setData([{codeId: bsdata.placecity, codeName: bsdata.placecityName}]);
                placecou.setData([{codeId: bsdata.placecou, codeName: bsdata.placecouName}]);
                placevill.setData([{codeId: bsdata.placevill, codeName: bsdata.placevillName}]);

                arrestpro.setData([{codeId: bsdata.arrestpro, codeName: bsdata.arrestproName}]);
                arrestcity.setData([{codeId: bsdata.arrestcity, codeName: bsdata.arrestcityName}]);
                arrestcou.setData([{codeId: bsdata.arrestcou, codeName: bsdata.arrestcouName}]);
                arrestvill.setData([{codeId: bsdata.arrestvill, codeName: bsdata.arrestvillName}]);

                investigatePro.setData([{codeId: bsdata.investigatePro, codeName: bsdata.investigateProName}]);
                investigateCity.setData([{codeId: bsdata.investigateCity, codeName: bsdata.investigateCityName}]);
                investigateCou.setData([{codeId: bsdata.investigateCou, codeName: bsdata.investigateCouName}]);
                investigateVill.setData([{codeId: bsdata.investigateVill, codeName: bsdata.investigateVillName}]);

                if (bsdata.hjType == '02') {
                    hjTypeOnclick();
                } else {
                    // hjOnclick();
                    var value = bsdata.priAddr;
                    if (value == "02") { // 城镇户籍
                        document.getElementById("wzhjry").style.display = "block";
                        document.getElementById("fdlj").style.display = "none";
                        document.getElementById("cbqhj").style.display = "none";
                    } else if (value == "03") {
                        // 户籍为监所
                        document.getElementById("wzhjry").style.display = "none";
                        document.getElementById("fdlj").style.display = "none";
                        document.getElementById("cbqhj").style.display = "none";
                    } else {//农村户籍
                        document.getElementById("wzhjry").style.display = "block";
                        document.getElementById("fdlj").style.display = "none";
                        document.getElementById("cbqhj").style.display = "none";
                    }
                }
            }
        });
    }

    /**
     * 查不清户籍人员地址
     */
    function onNoLiveChanged(e) {
        if ("investigatePro" == e) {
            investigatePro.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=-1";
            investigatePro.setUrl(url);
            investigatePro.select(0);
        }
        if ("investigateCity" == e) {
            var codeId = investigatePro.getValue();
            investigateCity.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=" + codeId;
            investigateCity.setUrl(url);
            investigateCity.select(0);
        }

        if ("investigateCou" == e) {
            var codeId = investigateCity.getValue();
            investigateCou.setValue("");
            var url = "/azbj/getCodeDetail/?codeType=2_1&codeId=" + codeId;
            investigateCou.setUrl(url);
            investigateCou.select(0);
        }

        if ("investigateVill" == e) {
            var parent_code = investigateCou.getValue();
            investigateVill.setValue("");
            var url = "/azbj/getCodeDetail?codeType=2_1&codeId=" + parent_code;
            investigateVill.setUrl(url);
            investigateVill.select(0);
        }
    }

    function onNoChanged(e) {
        if ("investigatePro" == e) {
            investigateCity.setValue("");
            investigateCou.setValue("");
            investigateVill.setValue("");
        }
        if ("investigateCity" == e) {
            investigateCou.setValue("");
            investigateVill.setValue("");
        }
        if ("investigateCou" == e) {
            investigateVill.setValue("");
        }
    }

    function onMouseOut() {
        var id = mini.get("idNum").getValue();
        if(idType.getValue()=="1" || idType.getValue()=="2") {
            if (id.length == 18 && onIDCardsValidation(idNum.getValue())) {
                var age = id.substring(6, 10) + "-" + id.substring(10, 12) + "-" + id.substring(12, 14);
                mini.get("Age").setValue(age);
                var num = id[16];
                if(num%2 ==0){
                    mini.get("Sex").setValue("2");
                } else {
                    mini.get("Sex").setValue("1");
                }
            } else if (id.length == 15 && onIDCardsValidation(idNum.getValue())) {
                var num = id[14];
                if(num%2 ==0){
                    mini.get("Sex").setValue("2");
                } else {
                    mini.get("Sex").setValue("1");
                }
            } else {
                mini.alert("请输入正确的身份证号码");
            }
        }
    }
</script>
</body>
</html>